﻿@using User.EF.Model
@using User.Global.Constvalues.Web.Navigation
@using User.Web.Common.HtmlHelper
@using User.Web.UI.Helper.RightsManagement
<html>
<head>
    <title>@ViewBag.Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    @Scripts.Render("~/bundles/modernizr")
    @Styles.Render("~/styles/bootAndFont")
    @Styles.Render("~/Content/myCss")
</head>
<body>
    <!-- Wrap all page content here -->
    <div id="wrap">

        <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
            <div class="container">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="@Url.Action("Index", "Home")">@PageTitles.Brand</a>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li class="@Html.GetActiveMenue(EController.Home, EActionHome.Index)">
                            @Html.ActionLink(ControlNames.Home, "Index", "Home")
                        </li>
                        @if (WebRights.HasRight(EMemberRight.VocableModule))
                        {
                            <li class="@Html.GetActiveMenue(EController.VocableModule, EActionVocableModule.Main)">
                                @Html.ActionLink(ControlNames.VocableTrainer, "Main", "VocableModule")
                            </li>
                        }
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        @if (HttpContext.Current.Request.IsAuthenticated)
                        {
                            if (WebRights.HasRight(EMemberRight.AdminModule))
                            {
                                <li class="@Html.GetActiveMenue(EController.Admin, EActionAdministration.MemberList, EActionAdministration.MemberRights, EActionAdministration.MemberDetails, EActionAdministration.MemberEditAdmin)">
                                    <a href="@Url.Action("MemberList","Admin")" class="pic"><i class="fa fa-users fa-lg"></i></a>
                                </li>
                            }
                            <li class="@Html.GetActiveMenue(EController.Account, EActionAccount.ChangePassword, EActionAccount.MemberEdit)">
                                <a href="@Url.Action("MemberEdit","Account", new { id=HttpContext.Current.User.Identity.Name })" class="pic"><i class="fa fa-user fa-lg"></i></a>
                            </li>
                            <li>
                                <a href="@Url.Action("Logoff","Account")" class="pic"><i class="fa fa-power-off fa-lg"></i></a>
                            </li>
                        }
                        else
                        {
                            <li class="@Html.GetActiveMenue(EController.Account, EActionAccount.Register, EActionAccount.RegisterSuccess)">
                                @Html.ActionLink(ControlNames.Register, "Register", "Account", null, new { @class = "" })
                            </li>
                            <li class="@Html.GetActiveMenue(EController.Account, EActionAccount.Login, EActionAccount.RecoverPassword, EActionAccount.RecoverySetNewPassword)">
                                @Html.ActionLink(ControlNames.Login, "Login", "Account", null, new { @class = "" })
                            </li>
                        }
                    </ul>
                </div>

            </div>
        </nav>
        <div class="container">
            @RenderBody()
        </div>
    </div>
    
    <div id="footer">
        <div class="container">
            <h4 class="text-muted">FOOTER Content </h4>
        </div>
    </div>

    @Scripts.Render("~/bundles/main")
    @RenderSection("scripts", required: false)
</body>
</html>
